import request from '@/config/axios'

export interface ReportVO {
  id?: number
  proId?: number,
  stuId?: number,
  expContent?: string,
  score?: string,
  conclusion?: string,
  teaSum?: string,
  tutor?: string,
}

export interface DelVO {
  id?: number,
  ids?: number[]
}


// 查询报告列表
export const getReportPage = (data: PageParam) => {
  return request.post({url: '/laboratory/report/query', data})
}
export const getReportPageByStudent = (data: any) => {
  return request.post({url: '/laboratory/report/queryByStudent', data})
}
// 查询报告列表
export const getReport = (id: number) => {
  return request.get({url: '/laboratory/report/queryById/' + id})
}
// 查询报告列表
export const getCurrentInfo = () => {
  return request.post({url: '/system/auth/getCurrentUserInfo'})
}

// 添加报告
export const addReport = async (data: ReportVO) => {
  return await request.post({url: '/laboratory/report/add', data})
}
// 添加报告
export const studentUpdateReport = async (data: any) => {
  return await request.put({url: '/laboratory/report/edit', data})
}
export const studentAddReport = async (data: any) => {
  return await request.put({url: '/laboratory/report/updateByStudent', data})
}
export const updateByTeacher = async (data: any) => {
  return await request.put({url: '/laboratory/report/updateByTeacher', data})
}


// 删除报告
export const deleteReport = async (data: any) => {
  return await request.delete({url: '/laboratory/report/delete', data})
}

// 修改报告
export const updateReport = async (data: ReportVO) => {
  return await request.put({url: '/laboratory/report/edit', data})
}

// 查询设备列表
export const getEquipmentPage = async (data: any) => {
  return await request.post({url: '/device/query', data})
}
// 添加设备
export const AddEquipment = async (data: any) => {
  return await request.post({url: '/device/add', data})
}

// 修改设备
export const updateEquipment = async (data: any) => {
  return await request.put({url: '/device/edit', data})
}

// 删除设备
export const deleteEquipment = async (data: any) => {
  return await request.delete({url: '/device/delete', data})
}

// id查设备
export const getEquipmentById = (id: number) => {
  return request.get({url: '/device/queryById/' + id})
}

// 设备名称下拉框
export const getEquipmentNameList = () => {
  return request.get({url: 'device/querySelect'})
}


// 查询维修设备列表
export const getEquipmentMaintainPage = async (data: any) => {
  return await request.post({url: '/device/maintain/query', data})
}
// 添加维修设备
export const addEquipmentMaintain = async (data: any) => {
  return await request.post({url: '/device/maintain/add', data})
}

// 修改维修设备
export const updateEquipmentMaintain = async (data: any) => {
  return await request.put({url: '/device/maintain/edit', data})
}

// 删除维修设备
export const deleteEquipmentMaintain = async (data: any) => {
  return await request.delete({url: '/device/maintain/delete', data})
}

// id查维修设备
export const getEquipmentMaintainById = (id: number) => {
  return request.get({url: '/device/maintain/queryById/' + id})
}

// 设备故障状态
export const getEquipmentTypeList = async (data: PageParam) => {
  return await request.get({
    url: `/system/dict-data/page?pageNo=${data.pageNo}&pageSize=${data.pageSize}&dictType=${data.dictType}`,
    data
  })
}



